package com.beiming.libra.domain.dto.responsedto;

import com.beiming.libra.common.utils.BeanConvertUtils;
import com.beiming.libra.domain.ArbitrationCaseProblem;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @Auther: 郑宇
 * @Date: 2018/6/8
 * @类描述: 问题单返回结果参数
 */
public class CaseProblemAndAnswerResponseDTO implements Serializable {

  /**
   * id
   */
  @ApiModelProperty(value = "问题单表id", hidden = false)
  private String id;

  /**
   * 仲裁申请表id
   */
  @ApiModelProperty(value = "仲裁申请表id",  hidden = false)
  private String caseId;

  /**
   * 序号
   */
  @ApiModelProperty(value = "序号", hidden = false)
  private Integer seqNo;

  /**
   * 问题标题
   */
  @ApiModelProperty(value = "问题标题", hidden = false)
  private String problemTitle;

  /**
   * 提问人id
   */
  @ApiModelProperty(value = "提问人id", hidden = false)
  private String userId;

  /**
   *  创建时间
   */
  @ApiModelProperty(value = "创建时间", required = false, hidden = false)
  private Date createTime;

  /**
   * 该问题所有人的回答信息
   * */
  private List<AnswerResponseDTO> answerResponseDTOs;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getCaseId() {
    return caseId;
  }

  public void setCaseId(String caseId) {
    this.caseId = caseId;
  }

  public Integer getSeqNo() {
    return seqNo;
  }

  public void setSeqNo(Integer seqNo) {
    this.seqNo = seqNo;
  }

  public String getProblemTitle() {
    return problemTitle;
  }

  public void setProblemTitle(String problemTitle) {
    this.problemTitle = problemTitle;
  }

  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  public String getCreateTime() {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    return simpleDateFormat.format(this.createTime);
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public List<AnswerResponseDTO> getAnswerResponseDTOs() {
    return answerResponseDTOs;
  }

  public void setAnswerResponseDTOs(List<AnswerResponseDTO> answerResponseDTOs) {
    this.answerResponseDTOs = answerResponseDTOs;
  }

  public static CaseProblemAndAnswerResponseDTO getData(ArbitrationCaseProblem arbitrationCaseProblem, List<AnswerResponseDTO> answerResponseDTOs) {
    CaseProblemAndAnswerResponseDTO caseProblemAndAnswerResponseDTO = BeanConvertUtils.copyBean(arbitrationCaseProblem, CaseProblemAndAnswerResponseDTO.class);
    caseProblemAndAnswerResponseDTO.setAnswerResponseDTOs(answerResponseDTOs);

    return caseProblemAndAnswerResponseDTO;
  };

}
